<?php
/**
 * Core_Data_Xssinternetexplorer
 * Only works in IE: <span style="width: expression(alert('Ping!'));"></span>
 * 
 * @author Adrian Stolarski
 */
class Core_Data_Xssinternetexplorer implements Core_Data_Xssfilterable {
    
    /**
     * xss_filter()
     * xss internet explorer
     * 
     * @param type $value
     * @return type $value
     */
    public function xss_filter($value) {
        $value = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?expression[\x00-\x20]*\([^>]*+>#i', '$1>', $value);
        $value = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?behaviour[\x00-\x20]*\([^>]*+>#i', '$1>', $value);
        $value = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:*[^>]*+>#iu', '$1>', $value);
        return $value;
    }

}
